﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
	<CodeSnippet Format="1.0.0">
		<Header>
			<Title>initialize</Title>
			<Author>zeroflag</Author>
			<Description></Description>
			<HelpUrl></HelpUrl>
			<SnippetType>SurroundsWith/Expansion</SnippetType>
			<Shortcut>#fkl</Shortcut>
			<Keywords>
				<Keyword>foreign key from list</Keyword>
				<Keyword>fkl</Keyword>
			</Keywords>
		</Header>
		<Snippet>
			<References />
			<Imports />
			<Declarations>
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Name</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>Value</Default>
					<Function></Function>
				</Literal>	
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Source</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>foo</Default>
					<Function></Function>
				</Literal>	
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Data</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>dt</Default>
					<Function></Function>
				</Literal>
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Property</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>Prop</Default>
					<Function></Function>
				</Literal>
				<Object Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Type</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>object</Default>
					<Function></Function>
				</Object>
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Documentation</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>//TODO: Add documentation</Default>
					<Function></Function>
				</Literal>
				<Object Editable="false">
					<ID>Class</ID>
					<Function>ClassName()</Function>
				</Object>
				<!--
				<Literal Editable="true" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
					<ID>Initialization</ID>
					<Type></Type>
					<ToolTip></ToolTip>
					<Default>//TODO: Initialize...</Default>
					<Function></Function>
				</Literal>
				-->
			</Declarations>
			<Code Language="CSharp" Delimiter="$">
				<![CDATA[
private $Type$ _$Name$;

/// <summary>
/// The $Name$ for this $Class$.
/// </summary>
public $Type$ $Name$
{
get
{
if (_$Name$ == null && !ReferenceEquals(this.Data.$Data$, null))
{
lock(this)
{
if (_$Name$ == null)
{
this._$Name$ = $Source$.FirstOrDefault(i => i.$Property$ == this.Data.$Data$);
}
}
}
return _$Name$;
}
set
{
if (_$Name$ != value)
{
if (value == null)
{
	this.Data.$Data$ = null;
}
else
{
	this.Data.$Data$ = value.$Property$;
}
_$Name$ = value;
this.OnPropertyChanged("$Name$");
}
}
}
]]>
			</Code>
		</Snippet>
	</CodeSnippet>
</CodeSnippets>